import React from 'react'
import { Outlet, Navigate, useLocation } from 'umi'
import { isLogin } from '@/utils'
export default function index() {
  const path = useLocation().pathname
  return (
    <>
      {
        isLogin() ?
          <Outlet />
          :
          <Navigate to='/beforeLogin' state={
            {
              path
            }
          } replace={true} />
      }
    </>
  )
}
